#include <stdio.h>
int main()
{
    int a,b,i,t1,t2,t;
    while (scanf("%d%d",&a,&b)!=EOF)
    {
        t1=t2=0;
                  if (a>b){t=b;b=a;a=t;}
        for (i=a;i<=b;i++)
        {
            if (i%2==1)t1+=i*i*i;
            else t2+=i*i;
        }
        printf("%d %d\n",t2,t1);
    }
    return 0;
}
